<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body>
<script type="text/javascript">

    function login() {
        var name = document.getElementById("username").value;
        var password = document.getElementById("pwd").value;
        if (name == "123" && password == "123") {
            alert("登录成功！");
        } else {
            document.getElementById("pwd").value = '';
        }
    }
</script>
<table>
    <tr>
        <td>姓名：<input  type="text" id="username" placeholder="输入名字" required ></td>
    <tr><td>密码：<input  type="password" id="pwd" placeholder="输入密码" required></td></tr>
    <tr><td><button id="login" onclick="login()">登录</button></td></tr>
    </tr>
</table>
</body></html>
